<?php
require_once(dirname(__FILE__)."/ArrayToObject.class.php");


final class Request extends ArrayToObject{
    static private $isPost = false;
    static private $isAjax = false;
    static private $singleton = null;
    static private $singletonIsset = false;

    public function __construct()
    {
        if(self::$singletonIsset==false){
            self::$singletonIsset = true;
            self::$singleton = $this;
            self::$isPost = !empty($_POST);
            self::$isAjax = !empty($_REQUEST['ajax']);
            self::$singleton->items = $_REQUEST;
        }
    }

    public function isPost()
    {
        return self::$isPost;
    }

    public function isAjax()
    {
        return self::$isAjax;
    }
}
